package javabasics.jvm;

/**
 * @Author suxiaoxiao
 * @Date 2019/8/4 20:07
 * @Version 1.0
 */
public class JVMCase {

    // 常量
    public final static String MAN_SE_TYPE = "man";

    // 静态变量
    public static String WOMAN_SEX_TYPE = "woman";

    public static void main(String[] args) {

        Student stu = new Student();
        stu.setName("nick");
        stu.setSexType(MAN_SE_TYPE);
        stu.setAge(20);

        // 调用静态方法
        print(stu);

        JVMCase jvmCase = new JVMCase();
        // 调用非静态方法
        jvmCase.sayHello(stu);
    }

    // 常规静态方法
    public static void print(Student student) {
        System.out.println("name: " + student.getName() +
                "; sex: " + student.getSexType() +
                "; age: " + student.getAge());

    }

    public void sayHello(Student student) {
        System.out.println(student.getName() + "say: hello");
    }

}
